package com.example.demo11;

import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Repository;

@Repository
public class TestRepository {
    @Cacheable(value = "user", key = "#id")
    public String getUsernameById(String id) {
        System.out.println("走数据库");
        return "jack";
    }
}
